<?php

class CartController extends Zend_Controller_Action
{

	protected $_cartModel;
	
    public function init()
    {
    	$this->_cartModel = new Model_Cart();
    }

    public function addAction(){
    	
    	if($this->getRequest()->isGet())
        {
        	echo "inside loop";
    		$product = $this->getRequest();
    		
    		if(null === $product)
    			throw new Exception('Product could not be added to cart');
    		
    		var_dump($product);
    		
    		foreach ($product as $key => $value){	//$key is ASIN/ISBN value and $value contains quantity
    			$this->_cartModel->addCartItem($key, $value);
    		}
        }
    }
    
    public function viewAction(){
    	$this->_view->cartModel = $this->_cartModel;
    }
    
    public function updateAction(){
    	
    }
    
    public function removeAction(){
    	
    }


}

